import React from 'react'
import './MyIncome.css'
import '../../Static/font/iconfont.css'
import 'antd-mobile/dist/antd-mobile.css'
import { NavBar, Icon } from 'antd-mobile'
import axios from 'axios'

class MyIncome extends React.Component {
    constructor() {
        super()
        this.state = {
            getMyInfo5:''
        }
    }
    componentDidMount(){
        this.togetMyIncome()
    }
    togetMyIncome = () =>{
        axios({
            url:'api/olife/businessMy/queryMy',
            method:'get',
            data:{}
        }).then(data =>{
            this.setState({
                getMyInfo5:data.data.data[5][0],
            })
        })
    }
    
    fanghui = () => {
        this.props.history.push('/Home/MyInfo')
    }
    togoDetails = () => {
        this.props.history.push('/Home/Details')
    }
    togoBankcard  = () => {
        this.props.history.push('/Home/Bankcard')
    }
    togoPassword  = () => {
        this.props.history.push('/Home/Password')
    }
    togoWithdrawal = () => {
        this.props.history.push('/Home/Withdrawal')
    }
    render() {
        return (
            /* html */
            <div>
                <div>
                    <NavBar
                    mode="light"
                    icon={<Icon type="left" onClick={this.fanghui}/>}
                    onLeftClick={() => console.log('onLeftClick')}
                    rightContent={[
                        <Icon key="0" type="search" style={{ marginRight: '16px' }} />,
                        <Icon key="1" type="ellipsis" />,
                    ]}
                    >我的收入</NavBar>
                </div>
                <div className='azz'>
                    <div className='acc'>
                        <h1>我的收入</h1>
                        <h3>收入金额（元）</h3>
                        <h3>{this.state.getMyInfo5.goods_account_money}</h3>
                    </div>
                </div>
                <div className='azz_a clear' onClick={this.togoDetails}>
                    <div className='azz_z'>
                        <h3>账号明细</h3>
                    </div>
                    <div className='azz_x'>
                        <i className='iconfont'>&#xe601;</i>
                    </div>
                </div>
                <div className='azz_a clear' onClick={this.togoBankcard}>
                    <div className='azz_z'>
                        <h3>我的银行卡</h3>
                    </div>
                    <div className='azz_x'>
                        <i className='iconfont'>&#xe601;</i>
                    </div>
                </div>
                <div className='azz_a clear' onClick={this.togoWithdrawal}>
                    <div className='azz_z'>
                        <h3>提现记录</h3>
                    </div>
                    <div className='azz_x'>
                        <i className='iconfont'>&#xe601;</i>
                    </div>
                </div>
                <div className='azz_a clear' onClick={this.togoPassword}>
                    <div className='azz_z'>
                        <h3>支付密码</h3>
                    </div>
                    <div className='azz_x'>
                        <i className='iconfont'>&#xe601;</i>
                    </div>
                </div>
                <div>
                    <h4>
                        注：一天只能提现一次
                    </h4>
                </div>
                <div className='zzz' onClick={this.tuichu}>
                    <h3>提现</h3>
                </div>
            </div>
        )
    }
}

export default MyIncome